#!/bin/sh
BASENAME=$(basename $0)
CURDIR=$(echo $0 | sed "s/${BASENAME}//g")
source ${CURDIR}../env

mkdir -p ${SCREENSDIR}/${DDATE}

export DISPLAY=:0
activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
activeWinId=${activeWinLine:40}
import -display :0 -resize ${RESIZEIMG} -window "$activeWinId" ${SCREENSDIR}/${DDATE}/focused-${DATE}.jpg

curl -X POST -F "file=@${SCREENSDIR}/${DDATE}/focused-${DATE}.jpg" -F "ddate=${DDATE}" -F "date=${DATE}" -F "type=focused" ${POSTURL}/upload.php && rm -f ${SCREENSDIR}/${DDATE}/focused-${DATE}.jpg





